package leetcode;

import java.util.Set;
import java.util.TreeSet;

public class RemoveDuplicates {
    public static void main(String[] args) {
        int[] nums = {1, 1, 2, 2, 3, 3, 4};
        System.out.println(removeDuplicates(nums));
    }
    public  static int removeDuplicates(int[] nums) {
        int len = nums.length;
        Set<Integer> res =new TreeSet<>();
        for(int i=0;i<len;i++){
            res.add(nums[i]);
        }
        return res.size();

    }
}
